/* eslint-disable @typescript-eslint/no-explicit-any */
const rc: {
  a: number;
  b: number;
  reComputed: () => void;
} = {
  a: 1,
  b: undefined,
  __proto__: {
    reComputed(this: { a: number; b: number }) {
      this.b = this.a;
    },
  },
} as any;

Object.defineProperty(rc, "b", {
  get() {
    return this.a * 2;
  },
});

console.log(rc);

rc.reComputed();

console.log(rc);

rc.a = 4;
console.log("---");
console.log(rc);

rc.reComputed();

console.log(rc);
/// //////////// //
// ///////////// //
// ///////////// //

const sig = (value: any) =>
  new Proxy(
    { value },
    {
      get(target, key, receiver) {
        if (key === "value") {
          console.log("get", target.value);
          return Reflect.get(target, key, receiver);
        }
      },
      set(target, key, value, receiver) {
        if (key === "value") {
          console.log("set", value);
          return Reflect.set(target, key, value, receiver);
        }
        return false;
      },
    },
  );
